/*******************************************************************************
* Copyright (c) 2012 
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* zhangliang - initial API and implementation
*******************************************************************************/

#ifndef CONFIG_H
#define CONFIG_H

#include <boost/property_tree/ptree_fwd.hpp>

/*!
 * @brief
 *  config system
 * @note
 *  config example:
 *
 *  <server>
 *    <module_path>?.so:modules/?.so</module_path>
 *    <svr_id>1</svr_id>
 *    <timer_feq>200</timer_feq>
 *    <preload_modules>
 *      <module>
 *        <name>test_module</name>
 *        <soname>test_module</soname>
 *        <args></args>
 *      </module>
 *      <module>
 *        <name>test_module_2</name>
 *        <soname>test_module_2</soname>
 *        <args></args>
 *      </module>
 *    </preload_modules>
 *  </server>
 */
class Config {
 public:
  static void Init(const std::string& config_file);
  static std::string Get(const char* path);
  static boost::property_tree::ptree& GetTree(void);

 public:
  static uint16_t kMaxMessageLength;
  static uint8_t kMaxServiceNameLength;

 private:
  Config(void) {}
  static boost::property_tree::ptree config_tree_;
};

#endif // CONFIG_H

